import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/views/Login.vue'
import Home from '@/views/Home.vue'
import Welcome from '@/views/welcome/Welcome.vue'
import User from '@/views/user/User.vue'

Vue.use(Router)  

export default new Router({
  routes: [
    {
      path: '/Login',
      name: 'Login',
      component: Login
    },
    {
      path: '/Home',
      name: 'Home',
      component: Home,
      // 路由重定向  登录进来以后直接跳转到welcome页面
      redirect: {path: 'Home/welcome'},
      children: [
        {
          path: 'welcome',
          name: 'Welcome',
          component: Welcome
        },
        {
          name: 'User',
          path: 'user',
          component: User
        }
      ]
    }
    
  ]
})
